﻿
@{
    ViewBag.Title = "UserInfosIndex";
}
<style>
     table{background-color:white;color:black;width:90%;margin:auto;border-radius:3px;text-align:center;}
    th{text-align:center;background-color:#585858;}
     .th-1{border-top-left-radius:3px;}
    .th-5{border-top-right-radius:3px;}
    footer{
        position:fixed;
        left:0;
        bottom:0;
        width:100%;
    }
   .user{
       display:none;
   }
</style>
<table class="table table-responsive">
    <tr>
        <th class="th-1">序列</th>
        <th>用户名</th>
        <th>用户密码</th>
        <th>所属单位</th>
        <th>职位</th>
        <th></th>
        <th class="th-5"></th>
    </tr>
    @{
        var i = 0;
        foreach (var item in ViewBag.list)
        {
            i += 1;
                    <tr>
                        <td>@i.ToString()</td>
                        <td>@item.UserName</td>
                        <td>@item.UserPwd</td>
                        @if (item.InsererName != null)
                                {
                            <td>@item.InsererName</td>
                                }
                        else
                        {
                            <td>@item.JudiciaryName</td>
                        }
                        <td>@item.RoleName</td>
                        @if (ViewBag.Role != null)
                         {
                            <td><div class="sys-btn"><a href="/BaseInfos/ModifyUserinfos?uid=@item.UserId" class="btn btn-default">修改</a>&nbsp;&nbsp;&nbsp;<a class="btn btn-default" data-toggle="modal" data-target="#@item.UserId" >删除</a></div></td>
                         }
                        <td>
                            <div class="modal" id="@item.UserId">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <div class="close" data-dismiss="modal">&times;</div>
                                            <div class="modal-title">删除用户【@item.UserName】</div>
                                        </div>
                                        <form action="/BaseInfos/DelUser" method="post">
                                            <div class="modal-body">
                                                是否删除此用户？
                                                <input class="user" name="userid" value="@item.UserId" />
                                            </div>
                                            <div class="modal-footer">
                                                <button type="submit" class="btn btn-default">确定</button>
                                                <button type="button" class="btn btn-default" data-dismiss="modal" >取消</button>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
        }
    }
</table>
<link href="~/Content/page.css" rel="stylesheet" />
@Html.Partial("Page");
